package com.cy.pj.gods.service.impl;

import com.cy.goods.dao.GoodsDao;
import com.cy.pj.goods.service.GoodsService;
import com.cy.pojo.Dao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务层
 */
@Service
public class GoodsServiceImpl implements GoodsService {
    //获取一个日志对象(推荐使用slf4j包中的日志对象-因为这是规范)
    private  static final Logger log= LoggerFactory.getLogger(GoodsServiceImpl.class);
    @Autowired
     private  GoodsDao goodsDao;
    public List<Dao> findGoods(){
        long t1=System.currentTimeMillis();
        log.info("start:{}",t1);//这里的{}是一个{}表示占位符
       //System.out.println("start"+t1);
        List<Dao> list = goodsDao.findAll();
        long t2=System.currentTimeMillis();
        log.info("start:{}",t2);
       // System.out.println("end"+t2);

        return list;
    }
}
